<div class="crumb-wrap">
    <div class="crumb-list"> <i class="icon-font"></i>
        <a href="<?=site_url()?>">首页</a>
        <span class="crumb-step">&gt;</span>
        <a class="crumb-name" href="<?=site_url('project')?>">项目管理</a>
        <span class="crumb-step">&gt;</span>
        <span>新增项目</span>
    </div>
</div>
<div class="search-wrap">
    <div class="search-content" style="margin-left: 20px">
        <a href="javascript:;" class="btn btn6 btn-primary mr10">创建项目</a>
        <a href="javascript:;" class="btn btn6 mr10" onclick="layer.alert('请提交项目之后再行进行操作')">设置参数</a>
        <!-- <a href="javascript:;" class="btn btn6 mr10" onclick="layer.alert('请提交项目之后再行进行操作')">客户填写</a> -->
    </div>
</div>
<div class="result-wrap">
    <div class="result-content">
        <form action="<?=site_url('project/create')?>" method="post" id="myform" name="myform" enctype="multipart/form-data">
            <table class="insert-tab" width="100%">
                <tbody>
                    <tr>
                        <th width="120"><i class="require-red">*</i>项目分类：</th>
                            <td>
                                <select name="sort_id" id="catid" class="required">
                                    <option value="0">其他分类</option>
                                    <?php foreach($list_sort as $k => $v):?>
                                        <option value="<?=$v['id']?>" ><?=$v['title']?></option>
                                    <?php endforeach;?>
                                </select>
                            </td>
                        </tr>
                    <tr>
                        <th width="120">
                            <i class="require-red">*</i>
                            项目名称：
                        </th>
                        <td>
                            <input class="common-text required" id="title" name="title" size="50" value="" type="text">
                            <span>将会显示到客户菜单栏中， 建议4个字符</span>
                        </td>
                    </tr>
                    <tr>
                        <th><i class="require-red">*</i>项目文档：</th>
                        <td>
                            <input class="common-text" name="article_title" size="50" value="" type="text" readonly="readonly" style="background:#f4f3f1">
                            <a href="javascript:;" class="btn btn-primary mr10" onclick="show_article()">选择文档</a>
                            <a href="<?=site_url('article/create')?>" target="_blank">没有？ 点击这里创建一个</a>
                        </td>
                    </tr>
                    <tr>
                        <th></th>
                        <td>
                            <input type="hidden" name="article_id" value="">
                            <input class="btn btn-primary btn6 mr10" value="提交" type="submit">
                            <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button"></td>
                    </tr>
                </tbody>
            </table>
        </form>
    </div>
</div>

<script type="text/javascript">
    function show_article(){
        layer.open({
            type: 2,
            area: ['800px', '600px'],
            fix: false, //不固定
            maxmin: true,
            title:'文档选择',
            content: "<?=site_url('article/choice')?>"
        });
    }

    $('#myform').submit(function() {
        var index = layer.load(2);
        $(this).ajaxSubmit(function(data){
            layer.close(index);
            if(data > 0){
                layer.alert("操作成功！",{
                    icon:1,
                },function(){
                    location.href='<?=site_url("project/update")?>?pid='+data;
                });
            }else{
                layer.alert(data,{
                    icon:2,
                });
            }
        })
        return false;
    })
</script>